import os,json
def clock(key=1):
    """写入格式[{x:x}],读取不需要填东西即可"""
    if not  os.path.exists("/clock"):
        os.system("sudo  mkdir  /clock")

    os.system("sudo chmod 777 /clock")
    
    if key != 1:
        #写入
        with open("/clock/clock.txt","w",encoding="utf-8")as f:
            f.write(   json.dumps( key ,ensure_ascii=False,indent=2 )  )
            
    else:
        #读取
        try:
            with open("/clock/clock.txt",encoding="utf-8") as f:
                return json.loads(f.read())
        except:
            return []